<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>欢迎来到我的第一个仓库</title>
  <style>
    /* 设置基础样式 */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      height: 100vh;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: linear-gradient(135deg, #667eea, #764ba2);
      color: white;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      animation: fadeIn 2s ease-in-out;
    }

    .container {
      text-align: center;
      max-width: 600px;
      padding: 20px;
    }

    h1 {
      font-size: 3rem;
      line-height: 1.4;
      font-weight: 700;
      letter-spacing: 1px;
    }

    #counter {
      font-size: 1.5rem;
      margin-top: 20px;
      color: #fff;
      opacity: 0.9;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(20px); }
      to { opacity: 1; transform: translateY(0); }
    }

    footer {
      position: absolute;
      bottom: 20px;
      width: 100%;
      text-align: center;
      font-size: 0.9rem;
      color: rgba(255, 255, 255, 0.7);
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>欢迎进入到我的第一个仓库！</h1>
    <div id="counter">加载中...</div>
  </div>

  <footer>
    &copy; 2025 我的第一个项目 | 欢迎来访
  </footer>

  <script>
    // 使用 countapi.xyz 提供的免费计数器服务
    const key = "my-first-repo-counter"; // 你可以修改为你自己的键名

    fetch(`https://api.countapi.xyz/hit/ ${key}/visits`)
      .then(res => res.json())
      .then(data => {
        document.getElementById("counter").innerText = `总访问次数：${data.value}`;
      })
      .catch(() => {
        document.getElementById("counter").innerText = "无法加载访问次数";
      });
  </script>
</body>
</html>